package com.hzsparrow.business.base.config.shiro;

import com.hzsparrow.business.base.entity.HzsUser;
import com.hzsparrow.business.base.mapper.HzsUserMapper;
import com.hzsparrow.framework.model.result.ResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ShiroUserRealmDAO {

    @Autowired
    private HzsUserMapper hzsUserMapper;

    /**
     * 通过账号获取用户信息
     *
     * @param hsuAccount
     * @return
     */
    public ResultDTO<HzsUser> getByAccount(String hsuAccount) {
        HzsUser entity = hzsUserMapper.getByAccount(hsuAccount);
        return ResultDTO.getDataSuccess(entity);
    }
}
